<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <title>20302120102-康明宇</title>
    <link rel="stylesheet" href="font_3702579_4ygcdyap1tu/iconfont.css">
    <link rel="stylesheet" href="CSS/index.css">
</head>
<body>
    <div id="head">
        <nav>
            <form action="">
                <a href="">
                    <span class="iconfont icon-saoma">
                </a>
                <input type="text" class="search" placeholder="耳机">
                <span class="iconfont icon-xiangji"></span>
                <input type="submit" value="搜索" class="submit">
            </form>
        </nav>
        <a>
            <span class="iconfont icon-xiaoxi"></span>
        </a>
        <div class="wzdh">
            <ul>
                <li>推荐</li>
                <li>省钱节</li>
                <li>食品</li>
                <li>内衣</li>
                <li>生鲜</li>
                <li>母婴</li>
            </ul>
        </div>
    </div>


    <div id="sqj">
        <a href="#"><img src="image/title.png" alt=""></a>
        <!-- JSON -->
    </div>

    <div id="cd">
        <ul>
            <li>
                <img src="image/tb1.png" alt="">
                <h3>1分抽奖</h3>
            </li>
            <li>
                <img src="image/tb2.png" alt="">
                <h3>9.9元3件</h3>
            </li>
            <li>
                <img src="image/tb3.png" alt="">
                <h3>天天特价</h3>
            </li>
            <li>
                <img src="image/tb4.png" alt="">
                <h3>工厂直发</h3>
            </li>
            <li>
                <img src="image/tb5.png" alt="">
                <h3>签到红包</h3>
            </li>
        </ul>
    </div>

    <div id="tttj">
        <div>
            <h1>天天特价</h1>
            <h2>晚八疯抢</h2>
            <h3>万人疯抢中</h3>
        </div>
        <div>
            <img src="image/tttj4.jpeg" alt="">
            <h6>￥9.9</h6>
        </div>
        <div>
            <img src="image/tttj3.jpeg" alt="">
            <h6>￥8.9</h6>
        </div>
        <div>
            <img src="image/tttj1.jpg" alt="">
            <h6>￥9.9</h6>
        </div>
    </div>

    <div id="body">
        <ul class="sp">
            <li>
                <div>
                    <a href="#"><img src="image/sp1.jpg" alt=""></a>
                </div>
                <p>【厂家直销】4层加厚卫生纸抽整箱原木木浆手纸</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥2</h1><h2>.18</h2><span class="span1">卷后价</span><span class="span2">已售9件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp2.jpg" alt=""></a>
                </div>
                <p>加大加厚高密珊瑚绒浴巾女四季可用不掉毛不掉色比纯棉吸水毛巾 颜色随机 毛巾75*35cm</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥4</h1><h2>.9</h2><span class="span1">卷后价</span><span class="span2">已售2.3万+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp3.jpg" alt=""></a>
                </div>
                <p>【限时特价】织梦80包卫生纸抽纸整箱批发家用可湿水纸巾便携式车用母婴面巾纸手纸 8包</p>
                <p class="zk">已省5元</p>
                <p class="jg"> <h1>￥1</h1><h2>.38</h2><span class="span1">卷后价</span><span class="span2">已售5件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp4.jpg" alt=""></a>
                </div>
                <p>【5-50包】小苏打粉清洁去污厨房洗衣服刷牙洗脸去黄多功能去污粉 升级款30g装【10包/标准】</p>
                <p class="jg"><h1>￥2</h1><h2>.18</h2><span class="span2">已售9件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp5.jpg" alt=""></a>
                </div>
                <p>懒人小火锅速食套餐组合二自热食品一箱煮素菜版学生宵夜240g素版自热火锅</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥1</h1><h2>.99</h2><span class="span1">卷后价</span><span class="span2">已售2.2万+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp6.jpg" alt=""></a>
                </div>
                <p>依能 加锌 无糖无汽弱碱 苏打水饮料 500ml*24瓶 可饮用水 塑膜装 冷藏风味更佳 饮用水</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥50</h1><h2>.9</h2><span class="span1">卷后价</span><span class="span2">已售183万件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp7.jpg" alt=""></a>
                </div>
                <p>TCL 65V8E 65英寸 120Hz 高色域 NFC投屏 2+32G 平板电视机 以旧换新</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥2</h1><h2>469</h2><span class="span1">卷后价</span><span class="span2">已售5件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp8.jpg" alt=""></a>
                </div>
                <p>南极人5双装儿童袜子春秋款透气男孩棉袜男童女童小孩宝宝袜秋冬季中筒棉袜 数字童袜-5双装 XL码（建议9-12岁适合脚长20-22CM）</p>
                <p class="jg"><h1>￥9</h1><h2>.9</h2><span class="span2">已售6400+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm1.jpg" alt=""></a>
                </div>
                <p>申花（SHENHUA） 养生壶煮茶器煮茶壶电水壶热水壶烧水壶电热水壶迷你玻璃花茶壶黑茶 K02标配款</p>
                <p class="zk">已省10元</p>
                <p class="jg"><h1>￥89</h1><h2></h2><span class="span1">卷后价</span><span class="span2">已售100+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm2.png" alt=""></a>
                </div>
                <p>钼联 智能语音小夜灯LED床头卧室睡眠感应灯家用人工语音控制迷你节能护眼学生宿舍儿童书桌学习护眼台灯 声控夜灯+充电器【调节亮度+节能不发烫】 USB小夜灯</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥5</h1><h2>.9</h2><span class="span1">卷后价</span><span class="span2">已售3000+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm3.jpg" alt=""></a>
                </div>
                <p>申花（SHENHUA） 双全自动上水电热水壶手柄上水家用一体玻璃茶台泡茶具煮茶电煮水壶煮茶器 SH997双上水煮杯款</p>
                <p class="zk">已省25元</p>
                <p class="jg"><h1>￥264</h1><h2></h2><span class="span1">卷后价</span><span class="span2">已售1件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm4.jpg" alt=""></a>
                </div>
                <p>箭牌 即热式电热水器电家用速热恒温卫生间厨房洗澡淋浴小型淋浴6000w SL-X7-60 黑色漏保款 自行安装</p>
                <p class="zk">已省50元</p>
                <p class="jg"><h1>￥273</h1><h2></h2><span class="span1">卷后价</span><span class="span2">已售1件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm5.jpg" alt=""></a>
                </div>
                <p>松下（panasonic） 全屋取暖器家用欧式快热炉电暖器速热遥控变频恒温浴室对流式防水防壁挂电暖气 AT2021CW【顶配升级款+全屋速热】</p>
                <p class="zk">已省25元</p>
                <p class="jg"><h1>￥264</h1><h2></h2><span class="span1">卷后价</span><span class="span2">已售8700+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm6.jpg" alt=""></a>
                </div>
                <p>陕西富士苹果带箱9斤装 膜袋青红富士新鲜水果 京东生鲜</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥30</h1><h2>.9</h2><span class="span1">卷后价</span><span class="span2">已售2.5万+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm7.png" alt=""></a>
                </div>
                <p>兰缦尼 【4条礼盒装】男士内裤男大码平角裤衩裸感无痕舒适透气中腰四角裤头【精选】 【4条礼盒装】卡其色+雾蓝色+气质绿+浩瀚灰 均码(建议80-160斤)</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥44</h1><h2>.9</h2><span class="span1">卷后价</span><span class="span2">已售13万+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm8.jpg" alt=""></a>
                </div>
                <p>蓓比舒可调转速婴儿保温摇奶器全自动冲奶粉机免手搓电动摇奶暖奶神器恒温智能调奶机 PB03-婴儿迷你辅食机</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥133</h1><h2></h2><span class="span1">卷后价</span><span class="span2">已售3.2万+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm9.jpg" alt=""></a>
                </div>
                <p>烁盟随身wifi数据终端移动wifi全国通用USB插口无线wifi车载笔记本网络无线网卡标准版</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥23</h1><h2></h2><span class="span1">卷后价</span><span class="span2">已售7000+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm10.jpg" alt=""></a>
                </div>
                <p>志高（CHIGO） 电水壶1.8L烧水壶电热水壶双层防烫自动断电家用烧水开水壶 ZY-P518【厂直】</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥28</h1><h2>.9</h2><span class="span1">卷后价</span><span class="span2">已售4万+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm11.jpg" alt=""></a>
                </div>
                <p>申花（SHENHUA） 全自动底部上水电热烧水壶泡茶专用烧水器茶台一体茶桌嵌入式抽水茶具套装 SH997玻璃煮杯款</p>
                <p class="zk">已省15元</p>
                <p class="jg"><h1>￥163</h1><h2></h2><span class="span1">卷后价</span><span class="span2">已售40+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/wdym/djdzm12.jpg" alt=""></a>
                </div>
                <p>卡布奇诺咖啡奶香咖啡粉三合一咖啡粉蓝山咖啡速溶特浓 550g【1袋+15条】55杯量</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥53</h1><h2>.5</h2><span class="span1">卷后价</span><span class="span2">已售7.5万</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp1.jpg" alt=""></a>
                </div>
                <p>【厂家直销】4层加厚卫生纸抽整箱原木木浆手纸</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥2</h1><h2>.18</h2><span class="span1">卷后价</span><span class="span2">已售9件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp2.jpg" alt=""></a>
                </div>
                <p>加大加厚高密珊瑚绒浴巾女四季可用不掉毛不掉色比纯棉吸水毛巾 颜色随机 毛巾75*35cm</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥4</h1><h2>.9</h2><span class="span1">卷后价</span><span class="span2">已售2.3万+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp3.jpg" alt=""></a>
                </div>
                <p>【限时特价】织梦80包卫生纸抽纸整箱批发家用可湿水纸巾便携式车用母婴面巾纸手纸 8包</p>
                <p class="zk">已省5元</p>
                <p class="jg"> <h1>￥1</h1><h2>.38</h2><span class="span1">卷后价</span><span class="span2">已售5件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp4.jpg" alt=""></a>
                </div>
                <p>【5-50包】小苏打粉清洁去污厨房洗衣服刷牙洗脸去黄多功能去污粉 升级款30g装【10包/标准】</p>
                <p class="jg"><h1>￥2</h1><h2>.18</h2><span class="span2">已售9件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp5.jpg" alt=""></a>
                </div>
                <p>懒人小火锅速食套餐组合二自热食品一箱煮素菜版学生宵夜240g素版自热火锅</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥1</h1><h2>.99</h2><span class="span1">卷后价</span><span class="span2">已售2.2万+件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp6.jpg" alt=""></a>
                </div>
                <p>依能 加锌 无糖无汽弱碱 苏打水饮料 500ml*24瓶 可饮用水 塑膜装 冷藏风味更佳 饮用水</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥50</h1><h2>.9</h2><span class="span1">卷后价</span><span class="span2">已售183万件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp7.jpg" alt=""></a>
                </div>
                <p>TCL 65V8E 65英寸 120Hz 高色域 NFC投屏 2+32G 平板电视机 以旧换新</p>
                <p class="zk">已省5元</p>
                <p class="jg"><h1>￥2</h1><h2>469</h2><span class="span1">卷后价</span><span class="span2">已售5件</span></p>
            </li>
            <li>
                <div>
                    <a href="#"><img src="image/sp8.jpg" alt=""></a>
                </div>
                <p>南极人5双装儿童袜子春秋款透气男孩棉袜男童女童小孩宝宝袜秋冬季中筒棉袜 数字童袜-5双装 XL码（建议9-12岁适合脚长20-22CM）</p>
                <p class="jg"><h1>￥9</h1><h2>.9</h2><span class="span2">已售6400+件</span></p>
            </li>
           
        </ul>
    </div>

    <div class="goBack">↑</div>

    <div id="foot">
        <ul>
            <li><a href="#"><h1 class="iconfont icon-shouye-"></h1>首页</a></li>
            <li><a href="#"><h1 class="iconfont icon-shexiangji"></h1>好看</a></li>
            <li class="ysz"><a href="#">省钱节</a></li>
            <li><a href="#"><h1 class="iconfont icon-gouwuche"></h1>购物车</a></li>
            <li><a href="#"><h1 class="iconfont icon-xiaolian"></h1>我的</a></li>
        </ul>
    </div>

    <script>
        var goBack = document.querySelector(".goBack");
        var nav = document.querySelector("body");

        window.addEventListener("scroll",function(){
            if(window.pageYOffset >= nav.offsetTop+1300){
                goBack.style.display="block";
            }else{
                goBack.style.display="none";
            }

            goBack.addEventListener("click",function(){
                window.scroll(0,0);
            })
        })


        window.onscroll = function(){

            var st = document.documentElement.scrollTop || document.body.scrollTop;

        if(st>head.offsetHeight){
            //clientHeight:元素的像素高度，包含元素的高度+内边距，不包含水平滚动条、边框和外边距。
            //offsetHeight:元素的像素高度，包括垂直内边距和边框，水平滚动条的高度。是一个整数。
            //scrollHeight:元素内容的高度，包括溢出的和不可见的内容。
            head.style.position = "fixed";
            // 复杂的改变CSS属性使用classlist
        }
        else{

            head.style.position = "relative";
            
        }
        }

        var xhr = new XMLHttpRequest();
        xhr.open("get", "/JSON/index.json", true);
        xhr.send();
        xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
          var data = JSON.parse(xhr.responseText);
          // 2.渲染数据
          var str = "";
          for (var i = 0; i < data.length; i++) {
            str += `
            <div>
            <a href="#"><img src="${data[i].img}" alt=""></a>
            <h2>${data[i].bt}</h2>
            </div>`;
          }
          document.querySelector("#sqj").innerHTML += str;
        }
      };
    </script>
</body>
</html>